package controllers.api;

import java.util.ArrayList;
import java.util.List;

import models.User;
import play.modules.mongo.MongoCursor;
import play.mvc.Controller;

public class Users extends API {
	
	public static void create(){
		User user = new User();
		user.setEmail(request.params.get("email"));
		user.setName(request.params.get("name"));
		user.setPassword(request.params.get("password"));
		user.save();
		json(user);
	}
	
	public static void list(){
		List<User> users = User.find().fetch();
		json(users);
	}
}
